package friot.service.cloud.config.mqtt;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author He Kuntao
 * @desc MQTT配置映射类
 * @date 2024/2/11 12:52
 */
@Data
@Component
@ConfigurationProperties(prefix = "emqx")
public class MqttProperties {
    /**
     * MQTT服务器地址
     */
    private String host;
    /**
     * MQTT服务器端口
     */
    private int port;
    /**
     * MQTT用户名
     */
    private String username;
    /**
     * MQTT密码
     */
    private String password;
    /**
     * 默认订阅主题
     */
    private String defaultTopic;
    /**
     * MQTT连接超时时间
     */
    private int timeout;
    /**
     * MQTT心跳间隔
     */
    private int keepalive;
    /**
     * MQTT是否清除会话
     */
    private boolean clearSession;
}
